home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 3 / CD ACTUAL 3.iso / linux / incoming / jstools-.6v3 / jstools- / jstools-tk3.6v3.0 / lib / jcompose.tcl < prev    next >
Encoding:
Text File  |  1995-02-05  |  2.4 KB  |  84 lines

  1. # jcompose.tcl - support for the Compose (Multi_key) key
  2. # Copyright 1994 by Jay Sekora.  All rights reserved, except 
  3. # that this file may be freely redistributed in whole or in part 
  4. # for non-profit, noncommercial use.
  5. ######################################################################
  6.  
  7. # this is used by jtextkeys.tcl and jentrykeys.tcl
  8. # TO DO: generalise to other character sets
  9. # merge entry and text procs - check class of window!
  10.  
  11. ######################################################################
  12. # j:tc:start_sequence W K A -
  13. #   begin a compose sequence.  bring in the compose key table if 
  14. #   necessary.
  15. ######################################################################
  16.  
  17. proc j:tc:start_sequence { W K A } {
  18.   global j_cmp
  19.   
  20.   set j_cmp(first,$W) $A
  21.   
  22.   if {![info exists j_cmp(iso8859-1)]} {
  23.     j:compose_init:iso8859-1
  24.   }
  25. }
  26.  
  27. ######################################################################
  28. # j:tc:finish_sequence W K A -
  29. #   finish a compose sequence.
  30. ######################################################################
  31.  
  32. proc j:tc:finish_sequence { W K A } {
  33.   global j_cmp
  34.   
  35.   if {![info exists j_cmp(iso8859-1)] ||
  36.       ![info exists j_cmp(first,$W)]} {
  37.     error "j:tc:finish_sequence called before j:tc:start_sequence"
  38.   }
  39.   
  40.   set pair [join [lsort -ascii [list $j_cmp(first,$W) $A]] {}]
  41.   catch {
  42.     j:tkb:process_key \
  43.       $W {} $j_cmp(iso8859-1,keysym,$pair) $j_cmp(iso8859-1,glyph,$pair)
  44.   }
  45. }
  46.  
  47. ######################################################################
  48. # j:ec:start_sequence W K A -
  49. #   begin a compose sequence.  bring in the compose key table if 
  50. #   necessary.
  51. ######################################################################
  52.  
  53. proc j:ec:start_sequence { W K A } {
  54.   global j_cmp
  55.   
  56.   set j_cmp(first,$W) $A
  57.   
  58.   if {![info exists j_cmp(iso8859-1)]} {
  59.     j:compose_init:iso8859-1
  60.   }
  61. }
  62.  
  63. ######################################################################
  64. # j:ec:finish_sequence W K A -
  65. #   finish a compose sequence.
  66. ######################################################################
  67.  
  68. proc j:ec:finish_sequence { W K A } {
  69.   global j_cmp
  70.   
  71.   if {![info exists j_cmp(iso8859-1)] ||
  72.       ![info exists j_cmp(first,$W)]} {
  73.     error "j:ec:finish_sequence called before j:ec:start_sequence"
  74.   }
  75.   
  76.   set pair [join [lsort -ascii [list $j_cmp(first,$W) $A]] {}]
  77.   catch {
  78.     j:ekb:process_key \
  79.       $W {} $j_cmp(iso8859-1,keysym,$pair) $j_cmp(iso8859-1,glyph,$pair)
  80.   }
  81. }
  82.  
  83.